// 导入 express
const express = require('express')
// 创建路由对象
const router = express.Router()

const expressJoi = require('@escook/express-joi');
// 2. 导入需要的验证规则对象
const { add_cate_schema ,delete_cate_schema,update_cate_schema} = require('../schema/artcate')
// 导入处理函数模块
const artcatehandler = require('../router_handler/artcate');

// 获取文章分类的列表数据
router.get('/article/cates', artcatehandler.getCates);
// 添加文章分类
router.post('/article/addcates', expressJoi(add_cate_schema), artcatehandler.addCates);

router.get('/article/deletecate/:id', expressJoi(delete_cate_schema), artcatehandler.delCates);

router.get('/article/cates/:id', expressJoi(delete_cate_schema), artcatehandler.Catesid);

// 更新文章分类的路由
router.post('/article/updatecate',expressJoi(update_cate_schema), artcatehandler.upCates)

// 向外共享路由对象
module.exports = router
